import React, {PureComponent} from 'react';
import {StyleSheet, View, Image, Text, TouchableOpacity} from 'react-native';

export default class extends PureComponent {
    render() {
        const {title, num, price} = this.props;
        let img = title === '今日' ? require('../../../images/icon_block_1.png') : require('../../../images/icon_block_2.png');
        return (
            <View style={styles.container}>
                <View style={styles.headerWrap}>
                    <Image source={img} style={styles.img}/>
                    <Text style={styles.headerText}>{title}</Text>
                </View>
                <View style={styles.detail}>
                    <View style={styles.item}>
                        <View style={styles.titleWrap}>
                            <Text style={styles.title}>付款笔数</Text>
                            <TouchableOpacity>
                                <Image source={require('../../../images/icon_question_2.png')} style={styles.img}/>
                            </TouchableOpacity>
                        </View>
                        <Text style={styles.money}>{num}</Text>
                    </View>
                    <View style={styles.item}>
                        <View style={styles.titleWrap}>
                            <Text style={styles.title}>预估佣金</Text>
                            <TouchableOpacity>
                                <Image source={require('../../../images/icon_question_2.png')} style={styles.img}/>
                            </TouchableOpacity>
                        </View>
                        <Text style={styles.money}>￥{price}</Text>
                    </View>
                </View>
            </View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        height: 98,
        marginTop: 9,
        backgroundColor: '#fff'
    },
    headerWrap: {
        paddingLeft: 24,
        paddingTop: 8,
        paddingBottom: 8,
        flexDirection: 'row',
        justifyContent: 'flex-start',
        alignItems: 'center'
    },
    headerText: {
        fontSize: 13,
        color: '#1c1919'
    },
    detail: {
        flexDirection: 'row'
    },
    item: {
        flex: 1,
        height: 50,
        alignItems: 'center',
        justifyContent: 'space-between'
    },
    img: {
        width: 20,
        height: 20
    },
    titleWrap: {
        flexDirection: 'row',
        justifyContent: 'center',
        alignItems: 'center'
    },
    title: {
        fontSize: 12,
        color: '#5a5a5a'
    },
    money: {
        fontSize: 11,
        color: '#5a5a5a'
    },
    text: {
        fontSize: 9,
        color: '#a7a7a7'
    }
});
